import urllib.request
import urllib.error

url = "https://blog.csdn.net/m0_61925586/article/details/137076327"

# 请求对象的定制是防止反扒的第一手段
headers = {
    'user-agent:' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0'
}

try:
    request = urllib.request.Request(url=url, headers=headers)

    response = urllib.request.urlopen(request)

    context = urllib.read().decode('utf-8')

    print(context)
except urllib.error.HTTPError:
    print('系统正在升级！')
except urllib.error.URLError:
    print('还是正在升级！')